<template>
	<view>
		<div class="navlist-box" style="width: 100%;">
			<div class="nav-item" v-for="(item,i) in cateNavs" :key='i' @click="gotoDetails(item.article_id)">
				<image style="width: 88rpx;height: 88rpx;" :src="item.image_url" alt="" mode="aspectFill" />
				<div class="title">{{item.title}}</div>
			</div>
			<!-- 		<div class="nav-item" @click="goToClass()" >
				<image style="width: 88rpx;height: 88rpx;" src="/static/images/nav-icon/nav-icon15.png" alt="" mode="aspectFill" />
				<div class="title">全部</div>
			</div> -->
			<!-- <cc-nav-swiper :list="cateNavs" :rowCount="2" :columnCount="5" @itemClick="itemClick"></cc-nav-swiper> -->
		</div>
		<FootTabbar :currentIndex='1' />
	</view>
</template>

<script>
	import FootTabbar from '@/components/foot-tabbar/foot-tabbar.vue'
	export default {
		components: {
			FootTabbar
		},
		data() {
			return {
				cateNavs: [],

			}
		},
		onLoad() {
			this.getlist();
		},
		methods: {
			async getlist(){
				this.$H.get('/article/list',{
					categoryId : 10001
				}).then(res => {
					if (res.status == 200) {
						this.cateNavs = res.data.list.data;
					}
				})
			},
			// 跳转到公司详情
			gotoDetails(id) {
				uni.navigateTo({
					url: '/pages/classify-details/classify-details?id=' + id,
				})
			},
		}
	}
</script>

<style scoped lang="scss">
	.navlist-box {
		// padding: 10rpx;
		box-sizing: border-box;
		margin-top: 20rpx;
	}

	.navlist-box {
		display: flex;
		flex-wrap: wrap;

		.nav-item {
			width: 25%;
			text-align: center;
			padding: 10rpx 0px;

			image {
				box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
				border-radius: 50%;
			}

			.title {
				color: #8f8f94;
				font-size: 24rpx;
			}
		}
	}
</style>